<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xml:lang="en" lang="en">
    <head>
        <title>Binding Engine JavaScript unit test file</title>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />

        <script src="../libs/javascript-xpath-latest-cmp.js" type="text/javascript"></script>
        <script src="../src/dbe.js" type="text/javascript"></script>
        <script src="../src/metaphorea.js" type="text/javascript"></script>

        <script src="jsunittest/jsunittest.js" type="text/javascript"></script>
        <link rel="stylesheet" href="jsunittest/unittest.css" type="text/css" />
    </head>
    <body>

        <div id="content">

            <div id="header">
                <p>tests :
                    <a href="dbe_test.html">dbe</a>
                    <a href="metaphorea_test.html">metaphorea</a>
                    <a href="metaphorea_scale_test.html">scaling</a>
                    <a href="metaphorea_interaction_test.html">interaction</a>
                    <a href="metaphorea_demo.html">demo</a>
                </p>
                <h1>metaphorea scaling tests</h1>
                <p>these tests may take a while be patient and if asked, tell browser to continue slow script</p>
            </div>

            <!-- Log output (one per Runner, via {testLog: "testlog"} option)-->
            <div id="testlog"></div>
            <a href="javascript:stopProfile();">stop Profiling</a>

            <!-- Put sample/test html here -->
            <div id="sample">
                data items :
                <a href="?scale=1">10^1</a>
                <a href="?scale=2">10^2</a>
                <a href="?scale=3">10^3</a>
                <a href="?scale=4">10^4</a>
                <a href="?scale=5">10^5</a>
                <div id="targetViewsSpace">
                </div>
            </div>
        </div>

        <script type="text/javascript">
            // <![CDATA[

            $metaphorea.setTarget("targetViewsSpace");
            console.profile();
            
            var scaleTest = function(s) {
                $metaphorea.setTarget("targetViewsSpace");
                $metaphorea.binding("bindings/sample_binding_10e"+s+".xml");
            }

            var stopProfile = function() {
                console.profileEnd();
            }

            // get scale as url var
            var searchString = document.location.search;
            searchString = searchString.substring(1);
            var nvPairs = searchString.split("&");
            for (i = 0; i < nvPairs.length; i++)
            {
                var nvPair = nvPairs[i].split("=");
                var name = nvPair[0];
                var value = nvPair[1];
                if (name === 'scale') {
                    scaleTest(value);
                    break;
                }
            }

            // ]]>
        </script>
    </body>
</html>